package com.thread.singleton;

/**
 * 饿汉式
 * 线程安全
 * 第一次加载类的时候，初始化静态变量
 */
public class HungrySingletonDemo {

    private static HungrySingletonDemo hungrySingletonDemo= new HungrySingletonDemo();

    private HungrySingletonDemo() {
    }

    public HungrySingletonDemo getInstance(){
        return hungrySingletonDemo;
    }
}
